﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Library.GeneralUtil
{
    public static class JsonHelper
    {
        /// <summary>
        /// Convert Oject to Json String
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static string ConvertObjectToJsonString(Object obj)
        {
            string res = "";
            try
            {
                res = JsonConvert.SerializeObject(obj);
            }
            catch (Exception)
            {
                throw;
            }
            return res;
        }
    }
}
